package com.jiandian.util;

import java.sql.Timestamp;
import java.time.LocalDate;
import java.time.temporal.ChronoUnit;

/**
 *
 */
public class DateUtil {
    /**
     * @param localDate
     * @param pop
     * @return 计算间隔天数
     */
    public static long calcIntervalDays(LocalDate localDate, LocalDate pop) {
        return localDate.until(pop, ChronoUnit.DAYS);
    }

    public static LocalDate timestampToLocalDate(Timestamp timestamp){
        return  timestamp.toLocalDateTime().toLocalDate();
    }
}
